﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;  

using KeePass.Util;
using KeePassLib.Collections;
//using KeePassLib.PwDefs;

namespace KeePassLib
{
    public class PwEntryObj 
    {
     
      
        public string entry;
        //Public groupListView As ind.pwd.pwdManagerGlobal.pwdGroupsEnum = pwdManagerGlobal.pwdGroupsEnum.generic
        public string username ;
        public string password ;
        public string url;
        //Public notes As String
        //Public creationDate As Date
        //Public modificationDate As Date
        public bool GetAutoTypeEnabled()
        {
            return true;
        }

        private AutoTypeConfig m_listAutoType = new AutoTypeConfig();
        /// <summary>
        /// Get or set all auto-type window/keystroke sequence associations.
        /// </summary>
        public AutoTypeConfig AutoType
        {
            get { return m_listAutoType; }
            set
            {
                Debug.Assert(value != null); if (value == null) throw new ArgumentNullException("value");
                m_listAutoType = value;
            }
        }

        public string GetAutoTypeSequence()
        {
            string strSeq = m_listAutoType.DefaultSequence;

            //PwGroup pg = m_pParentGroup;
            //while (pg != null)
            //{
            //    if (strSeq.Length != 0) break;

            //    strSeq = pg.DefaultAutoTypeSequence;
            //    pg = pg.ParentGroup;
            //}

            if (strSeq.Length != 0) return strSeq;

            //if (PwDefs.IsTanEntry(this)) return PwDefs.DefaultAutoTypeSequenceTan;
            return "{USERNAME}{TAB}{PASSWORD}{ENTER}";

        }

        private ProtectedStringDictionary m_listStrings = new ProtectedStringDictionary();
        /// <summary>
        /// Get or set all entry strings.
        /// </summary>
        public ProtectedStringDictionary Strings
        {
            get { return m_listStrings; }
            set
            {
                Debug.Assert(value != null); if (value == null) throw new ArgumentNullException("value");
                m_listStrings = value;
            }
        }


    }


}
